﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpObjects.Interfaces
{
    public interface IDataReader
    {
        bool GetBoolean(string path);
        bool GetBoolean(string path, bool defaultValue);
        bool[] GetBooleans(string path);

        int GetInteger(string path);
        int GetInteger(string path, int defaultValue);
        int[] GetIntegers(string path);

        long GetLong(string path);
        long GetLong(string path, long defaultValue);
        long[] GetLongs(string path);

        double GetDouble(string path);
        double GetDouble(string path, double defaultValue);
        double[] GetDoubles(string path);

        string GetString(string path);
        string GetString(string path, string defaultValue);
        string[] GetStrings(string path);

        DateTime GetDateTime(string path);
        DateTime GetDateTime(string path, DateTime defaultValue);
        DateTime[] GetDateTimes(string path);

        TEnum GetEnum<TEnum>(string path);
        TEnum GetEnum<TEnum>(string path, TEnum defaultValue);
        TEnum[] GetEnums<TEnum>(string path);

        T GetObject<T>(string path);
        T GetObject<T>(string path, T defaultValue);
        T GetObject<T>(string path, ITypeDescriptor typeInfo);
        T GetObject<T>(string path, ITypeDescriptor typeInfo, T defaultValue);
        T[] GetObjects<T>(string path);
        T[] GetObjects<T>(string path, ITypeDescriptor typeInfo);

        T GetAndInitializeObject<T>(string path, IInitializer<T> initializer);
        T GetAndInitializeObject<T>(string path, T defaultValue, IInitializer<T> initializer);
        T GetAndInitializeObject<T>(string path, ITypeDescriptor typeInfo, IInitializer<T> initializer);
        T GetAndInitializeObject<T>(string path, ITypeDescriptor typeInfo, T defaultValue, IInitializer<T> initializer);
        T[] GetAndConstructObjects<T>(string path, IInitializer<T> initializer);
        T[] GetAndConstructObjects<T>(string path, ITypeDescriptor typeInfo, IInitializer<T> initializer);
    }
}
